/**
 * Created by Administrator on 2015/4/14.
 */
var express = require('express');
var router = express.Router();
router.get('/', function(req, res, next) {

    res.render('ajaxS');
});
router.get('/users/:user', function(req, res, next) {
    var s=req.params.user;
    console.log(s+"-------------------");
    res.render('ajaxS');
});

router.post("/",function(req,res){
    var data = req.body;
    console.log(data);
    if(data['sa']==12345){
        return res.redirect('/hello');
        res.write('{"me":"hello"}');
        res.end();
    }
    else {
        res.write('{"me":"大家好"}');
        res.end();
    }
});

module.exports = router;